package com.congee02.dbservlet.result;

/**
 * 统一返回的结果，该类只能由 {@link ResultFactory} 取得
 * @param <T>   若成功则表示为数据类型，失败则为 Void 类型
 */
public final class Result<T> {

    private boolean ok;
    private Object data;
    private String msg;

    // 包可见
    Result(boolean ok, Object data, String msg) {
        this.ok = ok;
        this.data = data;
        this.msg = msg;
    }

    public boolean isOk() {
        return ok;
    }

    public void setOk(boolean ok) {
        this.ok = ok;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
